/**
 * 
 */
package t4j.exceptions;

/**
 * @author sz
 *
 * create time：2012-11-16
 */
public class WithFinally {
	static Switch sw = new Switch();
	
	public static int f(){
		try{
			return 0;
		}finally{
			System.out.println("f");
		}
	}
	
	public static void main(String[] args) {
		try{
			sw.on();
			
			OnOffSwitch.f();
			
			int a = f();
			
			System.out.println(a);
			
		}catch(OnOffException1 e){
			System.out.println("1");
		}catch(OnOffException2 e){
			System.out.println("2");
		}finally{
			sw.off();
			
			
		}
		
		
	}
}
